xen.git
18 years agoxenapi: Implement VM.set_VCPUs_at_startup and VM.set_VCPUs_max XenAPI
kfraser@localhost.localdomain [Wed, 13 Jun 2007 10:28:13 +0000 (11:28 +0100)]
xenapi: Implement VM.set_VCPUs_at_startup and VM.set_VCPUs_max XenAPI
methods in xend.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
18 years agoxenapi: Implement XenAPI method VBD.set_mode in python.
kfraser@localhost.localdomain [Wed, 13 Jun 2007 10:27:47 +0000 (11:27 +0100)]
xenapi: Implement XenAPI method VBD.set_mode in python.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
18 years agoxenapi: Fix segfault in libxenapi.
kfraser@localhost.localdomain [Wed, 13 Jun 2007 10:27:08 +0000 (11:27 +0100)]
xenapi: Fix segfault in libxenapi.

When calling xen_vbd_set_mode(), libxenapi attempted to convert enum
mode parameter to a string twice - resulting in segfault.  Removed
first conversion since conversion is taking place in
marshalling/demarshalling layer. Fixed similar double enum conversion
in other places as well.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
18 years agoxentop: Fix -b option (batch mode).
kfraser@localhost.localdomain [Wed, 13 Jun 2007 10:13:11 +0000 (11:13 +0100)]
xentop: Fix -b option (batch mode).

Some curses libraries don't work with xentop in batch mode, avoid
those calls. Avoid the over-verbose summary lines when batch mode is
requested.

Signed-off-by: Gary Pennington <gary.pennington@sun.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoAllow make targets to be called via make -C
kfraser@localhost.localdomain [Wed, 13 Jun 2007 10:05:47 +0000 (11:05 +0100)]
Allow make targets to be called via make -C

Change PWD to CURDIR in new mk.linux-2.6-xen to allow make targets to
be called via a make -C

From: Ben Guthro <bguthro@virtualiron.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agox86: ioapic_write() must check for weird redir entries with special
kfraser@localhost.localdomain [Wed, 13 Jun 2007 09:39:48 +0000 (10:39 +0100)]
x86: ioapic_write() must check for weird redir entries with special
delivery mode yet apparently valid vectoring information.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agox86: Initialise %ds when booting APs, otherwise data accesses go to
kfraser@localhost.localdomain [Tue, 12 Jun 2007 13:06:37 +0000 (14:06 +0100)]
x86: Initialise %ds when booting APs, otherwise data accesses go to
the wrong place.
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agox86: Gather BIOS EDD info during boot.
kfraser@localhost.localdomain [Tue, 12 Jun 2007 13:03:09 +0000 (14:03 +0100)]
x86: Gather BIOS EDD info during boot.
Still needs plumbing to dom0.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoFix fully-virtualized core dumps for 32-bit guests.
kfraser@localhost.localdomain [Tue, 12 Jun 2007 10:39:51 +0000 (11:39 +0100)]
Fix fully-virtualized core dumps for 32-bit guests.
Signed-off-by: Chris Lalancette <clalance@redhat.com>
18 years agotools: warn_unused_result build fixes.
kfraser@localhost.localdomain [Tue, 12 Jun 2007 10:38:31 +0000 (11:38 +0100)]
tools: warn_unused_result build fixes.

Note that some of the existing error checking for asprintf was wrong
for Linux.  asprintf in glibc returns -1 on error, but leaves the
pointer uninitialized.  Only the BSDs zero out the pointer on error.

Also, while fixing these warnings I saw several error paths that were
incorrect.  This patch minimally fixes the warn_unused_result; more
complete error path cleanup will be a later patch.

Signed-off-by: Charles Coffing <ccoffing@novell.com>
18 years ago[IA64] When a domU is destroyed, it will fall into NVRAM saving
kfraser@localhost.localdomain [Tue, 12 Jun 2007 10:32:03 +0000 (11:32 +0100)]
[IA64] When a domU is destroyed, it will fall into NVRAM saving
path. But if there is no NVRAM file for the domU, the save operation
would fail. Then domU blocked by Xend's exception. This patch fixs
that issue.

Signed-off-by: Zhang Xin <xing.z.zhang@intel.com>
18 years agoFix xm vcpu-pin command for keyword 'all'.
kfraser@localhost.localdomain [Tue, 12 Jun 2007 10:29:27 +0000 (11:29 +0100)]
Fix xm vcpu-pin command for keyword 'all'.

The keyword 'all' was supported as the 2nd argument of xm vcpu-pin
command since changeset 11619.  However, we cannot use the keyword
'all' since changeset 14481.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
18 years agotools: Clean up usage of const type qualifier.
kfraser@localhost.localdomain [Tue, 12 Jun 2007 10:26:51 +0000 (11:26 +0100)]
tools: Clean up usage of const type qualifier.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agox86: Fix VBE EDID interrogation. Add a new boot option 'edid={no,force}'.
kfraser@localhost.localdomain [Tue, 12 Jun 2007 10:04:27 +0000 (11:04 +0100)]
x86: Fix VBE EDID interrogation. Add a new boot option 'edid={no,force}'.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agox86: Fix time_resume() to notify all domains of wallclock change.
kfraser@localhost.localdomain [Tue, 12 Jun 2007 08:22:06 +0000 (09:22 +0100)]
x86: Fix time_resume() to notify all domains of wallclock change.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoInclude Solaris kernel headers
kfraser@localhost.localdomain [Mon, 11 Jun 2007 14:50:35 +0000 (15:50 +0100)]
Include Solaris kernel headers

Add the Solaris kernel headers used be the userspace tools to the
distribution. The same setup as used by Linux is taken. We modify the
Linux kernel headers to also install in /usr/include/xen/sys/ -
without a kernel-neutral path, it can make using the headers very
difficult, and encourages errors.

Signed-off-by: John Levon <john.levon@sun.com>
18 years agoAdd suspend/resume to devices owned by Xen.
kfraser@localhost.localdomain [Mon, 11 Jun 2007 14:44:48 +0000 (15:44 +0100)]
Add suspend/resume to devices owned by Xen.

Signed-off-by: Ke Yu <ke.yu@intel.com>
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agox86: Clean up interface to platform timers to extract more common code.
kfraser@localhost.localdomain [Mon, 11 Jun 2007 14:10:23 +0000 (15:10 +0100)]
x86: Clean up interface to platform timers to extract more common code.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years ago[QEMU] Fix up ioemu timer save/restore after version changes.
Tim Deegan [Mon, 11 Jun 2007 13:56:50 +0000 (14:56 +0100)]
[QEMU] Fix up ioemu timer save/restore after version changes.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
18 years ago[XEN] Clean up locking/init code around log-dirty interfaces
Tim Deegan [Mon, 11 Jun 2007 13:38:46 +0000 (14:38 +0100)]
[XEN] Clean up locking/init code around log-dirty interfaces
to avoid deadlocks and make sure locks/functions are in place for
PV domains to be put in log-dirty mode if they're not already shadowed.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
18 years ago[XEN] Make common log-dirty paging code and add HAP log-dirty support.
Tim Deegan [Mon, 11 Jun 2007 13:35:52 +0000 (14:35 +0100)]
[XEN] Make common log-dirty paging code and add HAP log-dirty support.
Signed-off-by: Wei Huang <wei.huang2@amd.com>
18 years ago[TOOLS] sync qemu and python view of save filenames after 15241:b0109d3dc3dd
Tim Deegan [Mon, 11 Jun 2007 10:37:10 +0000 (11:37 +0100)]
[TOOLS] sync qemu and python view of save filenames after 15241:b0109d3dc3dd
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
18 years agoxend: Fix duplicate random MAC generation.
kfraser@localhost.localdomain [Mon, 11 Jun 2007 09:22:32 +0000 (10:22 +0100)]
xend: Fix duplicate random MAC generation.

Ensure that HVMImageHandler and NetifController see the same random
MAC address.

Signed-off-by: David Edmondson <dme@sun.com>
18 years agoxend: Make device detach wait for detach to complete.
kfraser@localhost.localdomain [Mon, 11 Jun 2007 09:21:11 +0000 (10:21 +0100)]
xend: Make device detach wait for detach to complete.

*-detach will wait till device is detached or time'ed out.
XendConfig will be updated, if detached.

Signed-off-by: Max Zhen <max.zhen@sun.com>
18 years agoxend: Do not give up auto-ballooning if ballooning is proceeding okay.
kfraser@localhost.localdomain [Mon, 11 Jun 2007 09:16:54 +0000 (10:16 +0100)]
xend: Do not give up auto-ballooning if ballooning is proceeding okay.
Under a loaded system, don't give up ballooning dom0 unless it's not
responding at all.

Signed-off-by: Ryan Scott <ryan.scott@sun.com>
18 years agoxend: Fix xm block-detach regression introduced by c/s 15157.
kfraser@localhost.localdomain [Mon, 11 Jun 2007 09:14:54 +0000 (10:14 +0100)]
xend: Fix xm block-detach regression introduced by c/s 15157.

Prior to this c/s, user was able to specify device name or id, e.g.
 xm block-detach dom xvdb
 xm block-detach dom 15728

Now, 'xm block-detach dom xvdb' silently fails.  xend.log does contain
the following

[2007-06-07 11:39:18 xend.XendDomainInfo 3775] DEBUG
(XendDomainInfo:519) devName=vbd/51712
[2007-06-07 11:39:18 xend.XendDomainInfo 3775] DEBUG
(XendDomainInfo:527) Could not find the device xvdb

This patch restores the previous behavior but retains the bugfix
introduced by c/s 15571.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
18 years agotools: Fix xenstored build error by checking vasprintf() return code.
Keir Fraser [Sun, 10 Jun 2007 18:58:22 +0000 (19:58 +0100)]
tools: Fix xenstored build error by checking vasprintf() return code.
Signed-off-by: Charles Coffing <ccoffing@novell.com>
18 years agohvm: e820 public header cleanup.
Keir Fraser [Sun, 10 Jun 2007 18:49:44 +0000 (19:49 +0100)]
hvm: e820 public header cleanup.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agodocs: Update for new 'vga=' boot option syntax.
Keir Fraser [Sun, 10 Jun 2007 18:29:32 +0000 (19:29 +0100)]
docs: Update for new 'vga=' boot option syntax.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agox86: Remove broken and unnecessary numa code from smpboot.c.
Keir Fraser [Sun, 10 Jun 2007 17:07:58 +0000 (18:07 +0100)]
x86: Remove broken and unnecessary numa code from smpboot.c.
This was trampling on random memory when node==NUMA_NO_NODE.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agox86: Fix save_all regs macro for new CONFIG_FRAME_POINTER define.
Keir Fraser [Sun, 10 Jun 2007 16:00:47 +0000 (17:00 +0100)]
x86: Fix save_all regs macro for new CONFIG_FRAME_POINTER define.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agox86: Fix log-level in printing e820 memory map.
Keir Fraser [Sun, 10 Jun 2007 15:12:51 +0000 (16:12 +0100)]
x86: Fix log-level in printing e820 memory map.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agox86: Allow selection of graphical video modes during boot.
Keir Fraser [Sun, 10 Jun 2007 14:58:08 +0000 (15:58 +0100)]
x86: Allow selection of graphical video modes during boot.

The 'vga=' boot option is extended as follows:

----------
 'vga=<mode-specifier>[,keep]' where <mode-specifier> is one of:

   'vga=ask':
      display a vga menu of available modes

   'vga=text-80x<rows>':
      text mode, where <rows> is one of {25,28,30,34,43,50,60}

   'vga=gfx-<width>x<height>x<depth>':
      graphics mode, e.g., vga=gfx-1024x768x16

   'vga=mode-<mode>:
      specifies a mode as specified in 'vga=ask' menu
      (NB. menu modes are displayed in hex, so mode numbers here must
           be prefixed with '0x' (e.g., 'vga=mode-0x0318'))

 The option 'keep' causes Xen to continue to print to the VGA console even
 after domain 0 starts to boot. The default behaviour is to relinquish
 control of the console to domain 0.
----------

Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoioemu: save file name is snprintf()ed into a plenty big enough buffer.
kfraser@localhost.localdomain [Fri, 8 Jun 2007 18:22:08 +0000 (19:22 +0100)]
ioemu: save file name is snprintf()ed into a plenty big enough buffer.
From: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoAvoid using /tmp for qemu state files since an unprivileged user
Steven Hand [Fri, 8 Jun 2007 16:37:58 +0000 (17:37 +0100)]
Avoid using /tmp for qemu state files since an unprivileged user
in dom0 could potentially exploit the fact.

Thanks to Dan Berrange <berrange@redhat.com>

Signed-off-by: Steven Hand
18 years agotools: Fix xm mem-max command.
kfraser@localhost.localdomain [Fri, 8 Jun 2007 10:21:21 +0000 (11:21 +0100)]
tools: Fix xm mem-max command.

When I tested xm mem-max and xm list, I saw the following error
message by xm list.  Because xm mem-max always changes
"memory_static_max", I think that the cause of the error message
is it.  This patch fixes it.

# xm list --long PVdomain.1 | grep mem
    (maxmem 1024)
    (memory 1024)
    (shadow_memory 0)
# xm mem-max PVdomain.1 512
Error: (22, 'Invalid argument')
Usage: xm mem-max <Domain> <Mem>

Set the maximum amount reservation for a domain.
# xm list --long PVdomain.1 | grep mem
Error: memory_dynamic_max must be less than or equal to
memory_static_max

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
18 years agohvm: Respect irqbase set by protected mode in mode switching with VMXAssist.
kfraser@localhost.localdomain [Fri, 8 Jun 2007 10:19:55 +0000 (11:19 +0100)]
hvm: Respect irqbase set by protected mode in mode switching with VMXAssist.

RHEL4U4 PAE SMP guest currently crashes, and we found changeset 15214
introduced it. This patch fixes it.

Signed-off-by: Xin Li <xin.b.li@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
18 years agox86: Print source of e820 memory map during boot. Fix Xen-e801 memmap
kfraser@localhost.localdomain [Thu, 7 Jun 2007 19:02:27 +0000 (20:02 +0100)]
x86: Print source of e820 memory map during boot. Fix Xen-e801 memmap
parsing. Get rid of unneeded e820_raw variable -- map straight onto
boot-trampoline e820 array.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agox86: Return to real-mode when booting primary CPU, and gather
kfraser@localhost.localdomain [Thu, 7 Jun 2007 18:41:59 +0000 (19:41 +0100)]
x86: Return to real-mode when booting primary CPU, and gather
memory-map information (from int15{e820,e801,88} and int12 bios
calls).

Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoFix the README to match Xen 3.1
kfraser@localhost.localdomain [Thu, 7 Jun 2007 15:44:04 +0000 (16:44 +0100)]
Fix the README to match Xen 3.1
From: Ryan Riley <rileyrd@gmail.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoAdd backtrace support to xenoprof.
kfraser@localhost.localdomain [Thu, 7 Jun 2007 13:30:21 +0000 (14:30 +0100)]
Add backtrace support to xenoprof.

Signed-off-by: Amitabha Roy <amitabha.roy@gmail.com>
Reviewed-by: Jose Renato G Santos <joserenato.santos@hp.com>
18 years agoioemu: Tiny indentation fix.
kfraser@localhost.localdomain [Thu, 7 Jun 2007 10:15:24 +0000 (11:15 +0100)]
ioemu: Tiny indentation fix.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoxentop: Display blktap information.
kfraser@localhost.localdomain [Thu, 7 Jun 2007 10:14:18 +0000 (11:14 +0100)]
xentop: Display blktap information.
Signed-off-by: Satoshi UCHIDA <s-uchida@ap.jp.nec.com>
18 years agoxenstat: Adding to scan blktap information.
kfraser@localhost.localdomain [Thu, 7 Jun 2007 10:13:41 +0000 (11:13 +0100)]
xenstat: Adding to scan blktap information.
Signed-off-by: Satoshi UCHIDA <s-uchida@ap.jp.nec.com>
18 years agoFix the vnet module for Xen 3.1.x.
kfraser@localhost.localdomain [Thu, 7 Jun 2007 10:06:00 +0000 (11:06 +0100)]
Fix the vnet module for Xen 3.1.x.
Signed-off-by: Robert Valentan <R.Valentan@solid-soft.at>
18 years agotools: Fix some type issues GCC 4.1.0 warnings.
kfraser@localhost.localdomain [Thu, 7 Jun 2007 10:02:23 +0000 (11:02 +0100)]
tools: Fix some type issues GCC 4.1.0 warnings.

FC5's gcc 4.1.0 can't make some files in tools/ due to its stronger
type checking.

From: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoqemu: Fix vnc port offset in xenstore
kfraser@localhost.localdomain [Wed, 6 Jun 2007 19:25:58 +0000 (20:25 +0100)]
qemu: Fix vnc port offset in xenstore

The new version of qemu uses 5900 instead of 0 as the port.
There is no need to offset it by 5900 when writing out the
console/vnc-port entry.

Signed-off-by: Ben Guthro <bguthro@virtualiron.com>
18 years ago[HVM] Prevent usb driver crashes in Windows
kfraser@localhost.localdomain [Wed, 6 Jun 2007 19:24:06 +0000 (20:24 +0100)]
[HVM] Prevent usb driver crashes in Windows

Use atomic updates to read/write usb controller data.
This can be done because:
    a) word copies on x86 are atomic
    b) The USB spec requires word alignment

This will need to be enhanced once USB 1.2 is supported.

Signed-off-by: Steve Ofsthun <sofsthun@virtualiron.com>
Update to copy 'longword'-sized atoms.

Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agopv-on-hvm: Allow Linux and Xen paths to be overridden by the environment.
kfraser@localhost.localdomain [Wed, 6 Jun 2007 16:49:39 +0000 (17:49 +0100)]
pv-on-hvm: Allow Linux and Xen paths to be overridden by the environment.
Signed-off-by: Ben Guthro <bguthro@virtualiron.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoFix pv-on-hvm mkbuildtree script for new repo layout.
kfraser@localhost.localdomain [Wed, 6 Jun 2007 16:32:58 +0000 (17:32 +0100)]
Fix pv-on-hvm mkbuildtree script for new repo layout.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoSynchronise xend-config file comments w.r.t. networking.
kfraser@localhost.localdomain [Tue, 5 Jun 2007 16:05:13 +0000 (17:05 +0100)]
Synchronise xend-config file comments w.r.t. networking.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years ago[PATCH] Check for non-existent local repo
Ian Campbell [Tue, 5 Jun 2007 14:52:46 +0000 (15:52 +0100)]
[PATCH] Check for non-existent local repo
Check for non-existent local clone in select-repository.
Also change the #!/bin/bash to #!/bin/sh since the Makefile is calling
it explicitly with sh, and fix a couple other typos.

Signed-off-by: Aron Griffis <aron@hp.com>
18 years ago[ACM] Python-to-C Interface for new ACM hypercalls.
kfraser@localhost.localdomain [Tue, 5 Jun 2007 14:51:59 +0000 (15:51 +0100)]
[ACM] Python-to-C Interface for new ACM hypercalls.

Provide an interface for using recently-added Xen functionality from
python.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
18 years agoxen: Boot on PAE systems with no EFER MSR.
kfraser@localhost.localdomain [Tue, 5 Jun 2007 09:28:59 +0000 (10:28 +0100)]
xen: Boot on PAE systems with no EFER MSR.
Bug tracked down by Stefan Berger.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agohvm vmx: Clean up vmx_io_instruction().
kfraser@localhost.localdomain [Tue, 5 Jun 2007 09:08:09 +0000 (10:08 +0100)]
hvm vmx: Clean up vmx_io_instruction().

vmx_io_instruction() is too long, so it's hard to understand or change
something. The attached patch splits it into several readable functions,
making it easer to understand and extend.

Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
18 years agoconsole daemon: Fix realloc() usage.
kfraser@localhost.localdomain [Tue, 5 Jun 2007 09:00:15 +0000 (10:00 +0100)]
console daemon: Fix realloc() usage.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoqemu: Use domid in qemu log name. Can be related back to domain name
kfraser@localhost.localdomain [Tue, 5 Jun 2007 08:59:34 +0000 (09:59 +0100)]
qemu: Use domid in qemu log name. Can be related back to domain name
or uuid via xend logs, less unique than pids to prevent excessive
number of log files hanging around, yet not immediately reused (unlike
e.g., after domain crash or reboot) where previous log file is
immediately overwritten. Not using domain names in logs avoids and
chance of unprintable charcatres becoming embedded in filenames.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoBUILD: Clone the Linux tree if it wasn't found via $(LINUX_SRC_PATH)
Ian Campbell [Tue, 5 Jun 2007 07:57:53 +0000 (08:57 +0100)]
BUILD: Clone the Linux tree if it wasn't found via $(LINUX_SRC_PATH)
even if it happens to be a local directory.

If we located the Linux tree by deriving the path from "hg path
default" and it is a local path then prepend "file://" to prevent us
trying to symlink it.

Unfortunately mercurial doesn't understand file:// URLs so we have to
strip it off again before calling hg clone.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
18 years ago[HVM] Save/restore: trigger FPU state save based on v->fpu_initialised
Tim Deegan [Mon, 4 Jun 2007 16:09:12 +0000 (17:09 +0100)]
[HVM] Save/restore: trigger FPU state save based on v->fpu_initialised
and not on the i387_valid flag, which has no meaning in this context.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
18 years agoEnsure CR0.TS is set for VMX domains regardless of the current
Steven Hand [Mon, 4 Jun 2007 15:47:48 +0000 (16:47 +0100)]
Ensure CR0.TS is set for VMX domains regardless of the current
state of the real TS bit. This fixes a number of subtle FP
corruption issues within PV domains when running alongside VMX ones.

Signed-off-by: Steven Hand <steven@xensource.com>
18 years agoIf we find a Linux repository in $(LINUX_SRC_PATH) then symlink it
Ian Campbell [Mon, 4 Jun 2007 14:41:32 +0000 (15:41 +0100)]
If we find a Linux repository in $(LINUX_SRC_PATH) then symlink it
instead of cloning it. This enables developers to keep a linux tree
separate to their xen repository and to make changes there which are
picked up by the Xen build.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
18 years agoFix boot loader hangs with syslinux's 32-bit vesamenu module.
kfraser@localhost.localdomain [Mon, 4 Jun 2007 14:32:11 +0000 (15:32 +0100)]
Fix boot loader hangs with syslinux's 32-bit vesamenu module.

Syslinux can load 32-bit UI code for menu handling.  But the core of
syslinux is still 16-bit.  When it jumps to this 32-bit code, it
installs a set of 32-bit interrupt trap handlers which just bounce the
interrupts back to 16-bit mode.

But this plays badly with vmxassist.  When running 16-bit boot loader
code, vmxassist installs its own trap handlers which bounce vPIC
interrupts back down to 16-bit mode.  The trap handlers live at
int 0x20 to 0x2f, so when the 16-bit code tries to reprogram the vPIC,
vm86 rewrites the outb()s on the fly to set the irq_base vectors
accordingly.

So when syslinux enters 32-bit mode, the vPIC has still been
programmed to point to vmxassist's bounce traps, even though vmxassist
is no longer active once the guest is running 32-bit code.  So the
wrong interrupts get delivered to the guest.

Fix this by restoring the rombios vPIC irq_base vectors when we leave
vmxassist mode, and returning the vmxassist traps when we reenter it.
These irq base values are hard-coded in this patch, but they are
already hard-coded in vmxassist so any boot code that relies on
changing them will already fail.

Signed-off-by: Stephen Tweedie <sct@redhat.com>
18 years agoqemu: More care over filename string sizes.
kfraser@localhost.localdomain [Mon, 4 Jun 2007 14:21:12 +0000 (15:21 +0100)]
qemu: More care over filename string sizes.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoUse name instead of pid in QEMU logs.
kfraser@localhost.localdomain [Mon, 4 Jun 2007 14:17:49 +0000 (15:17 +0100)]
Use name instead of pid in QEMU logs.

Change the logfile name generated by qemu-dm to use the pattern
qemu-dm-[NAME].log instead of qemu-dm-[PID].log. This makes it
easier for the adminsitrator to figure out which log corresponds to
which guest (particularly after a crash where you no long know what
PID the qemu-dm process for your guest had). It also prevents the
number of log files from growing unbounded.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
18 years agoAdd persistent guest & hv logging in xenconsoled.
kfraser@localhost.localdomain [Mon, 4 Jun 2007 13:49:12 +0000 (14:49 +0100)]
Add persistent guest & hv logging in xenconsoled.

  * The  --log  command line argument takes one of 4 values

      - none   - no logging   (the default)
      - hv     - log all hypervisor messages
      - guest  - log all guest messages
      - both   - log all guest & hypervisor messages

  * The --log-dir command line argument takes a path to specify where
    to store logfiles. If omitted it defaults to /var/log/xen/console

  * The hypervisor logfile is $LOGDIR/hypervisor.log

  * The guest logfile is  $LOGDIR/guest-[NAME].log

  * If receiving a SIGHUP it will close & re-open all log files to
    enable logrotate to do its magic

  * Fixes the permissions of /var/run/xenconsoled.pid

  * Adds a --pid-file command line argument to override the default
    location of pid file (this is not really related to logging, but
    since I was in that code...)

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
18 years agoEnable ACM on PPC
kfraser@localhost.localdomain [Mon, 4 Jun 2007 13:40:12 +0000 (14:40 +0100)]
Enable ACM on PPC
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
18 years agogdbstub: Bit-field boolean must be unsigned.
kfraser@localhost.localdomain [Mon, 4 Jun 2007 13:25:03 +0000 (14:25 +0100)]
gdbstub: Bit-field boolean must be unsigned.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoxentrace: Bit-field boolean must be unsigned.
kfraser@localhost.localdomain [Mon, 4 Jun 2007 13:24:46 +0000 (14:24 +0100)]
xentrace: Bit-field boolean must be unsigned.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoxen: Fix domain teardown to avoid use-after-free of vcpu structs.
kfraser@localhost.localdomain [Mon, 4 Jun 2007 13:05:10 +0000 (14:05 +0100)]
xen: Fix domain teardown to avoid use-after-free of vcpu structs.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoRemove a few stray references to the sparse tree.
Ian Campbell [Mon, 4 Jun 2007 11:47:53 +0000 (12:47 +0100)]
Remove a few stray references to the sparse tree.

The only non-obvious change here is in tools/xenfb/Makefile. This now picks up
the headers it requires via the copy in tools/libxc.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
18 years agoRemove $(LINUX_SRCDIR) on distclean.
Ian Campbell [Mon, 4 Jun 2007 10:37:50 +0000 (11:37 +0100)]
Remove $(LINUX_SRCDIR) on distclean.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
18 years agoRemove sparse tree.
Ian Campbell [Mon, 4 Jun 2007 10:16:19 +0000 (11:16 +0100)]
Remove sparse tree.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
18 years ago[NET] Remove netloop from network bridge init scripts.
kfraser@localhost.localdomain [Mon, 4 Jun 2007 10:01:46 +0000 (11:01 +0100)]
[NET] Remove netloop from network bridge init scripts.

The scripts are partly based on work by Daniel P. Berrange.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
18 years agoSwitch over to separate Linux tree.
Ian Campbell [Mon, 4 Jun 2007 09:14:53 +0000 (10:14 +0100)]
Switch over to separate Linux tree.

The sparse tree is now deprecated and will deleted in due course. The
xen-unstable build system will automatically clone the correct Linux
tree for you and all the old makefile targets
(dist/linux-2.6-xen{,0,U}/etc) should continue to work.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
18 years agoAdded tag sparse-tree-deprecated for changeset bd3d6b4c52ec809f080c89c4ffcf61dc6e445978
Ian Campbell [Mon, 4 Jun 2007 09:14:23 +0000 (10:14 +0100)]
Added tag sparse-tree-deprecated for changeset bd3d6b4c52ec809f080c89c4ffcf61dc6e445978

18 years ago[XEN] Shadow: cache gva->gfn+rights translations between guest TLB flushes
Tim Deegan [Fri, 1 Jun 2007 13:50:52 +0000 (14:50 +0100)]
[XEN] Shadow: cache gva->gfn+rights translations between guest TLB flushes
to make lookups faster for emulation and hvm_copy.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
18 years ago[XEN] Shadow: emulate a few extra instructions on PAE pagetable writes
Tim Deegan [Fri, 1 Jun 2007 13:32:11 +0000 (14:32 +0100)]
[XEN] Shadow: emulate a few extra instructions on PAE pagetable writes
in the hope of catching the "other half" write without another enter/exit.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
18 years agoVMX: Only write top-half of machine addresses into VMCS fields in PAE mode.
kfraser@localhost.localdomain [Thu, 31 May 2007 15:09:11 +0000 (16:09 +0100)]
VMX: Only write top-half of machine addresses into VMCS fields in PAE mode.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agohvm: Pause domain during state save/load.
kfraser@localhost.localdomain [Thu, 31 May 2007 15:05:27 +0000 (16:05 +0100)]
hvm: Pause domain during state save/load.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoUpdates for XEN_LINUX_SOURCE=hg-clone.
Ian Campbell [Thu, 31 May 2007 13:51:09 +0000 (14:51 +0100)]
Updates for XEN_LINUX_SOURCE=hg-clone.

By default search for mercurial repositories in $(LINUX_SRC_PATH)
followed by a location derived from the current Xen repository's
default parent. e.g. A clone of
http://xenbits.xensource.com/xen-unstable.hg will derive
http://xenbits.xensource.com/linux-2.6.18-xen.hg. A specific
repository can be specified by giving XEN_LINUX_HGREPO=<URL or path>
on the make command line.

Add capability to put XEN_LINUX_UPDATE=y on the make command line to
update the Linux repository. Disabled by default since we don't want
to touch a developers repository without permission.

Dropped XEN_LINUX_HGUPDATES since it was unecessary and confusing.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
18 years agohvm: Exceed maximum number of ioemu's NIC for VNIF.
kfraser@localhost.localdomain [Thu, 31 May 2007 09:58:22 +0000 (10:58 +0100)]
hvm: Exceed maximum number of ioemu's NIC for VNIF.

QEMU should ignore excess NICs instead of failing to initialise.

Signed-off-by: Takanori Kasai <kasai.takanori@jp.fujitsu.com>
Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
18 years agohvm: Allow GNTTABOP_query_size.
kfraser@localhost.localdomain [Thu, 31 May 2007 09:53:11 +0000 (10:53 +0100)]
hvm: Allow GNTTABOP_query_size.
Signed-off-by: Takanori Kasai <kasai.takanori@jp.fujitsu.com>
Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoFix stale email addresses in xenstat and xentop.
kfraser@localhost.localdomain [Thu, 31 May 2007 09:42:34 +0000 (10:42 +0100)]
Fix stale email addresses in xenstat and xentop.

Our @us.ibm.com emails cannot forward to us; we do not have access to
them when not interning at IBM.  People have attempted to reach us via
those addresses and failed; occasionally they've Googled for a current
address, which made us realize the problem.  Change each email to a
more permanent address, so people can reach us in the future.  Change
bug reporting addresses to a xen mailing list rather than an
individual.

Signed-off-by: Josh Triplett <josh@kernel.org>
18 years agoFix the very-slow-IDE-IO-speed issue of Qemu 0.90
kfraser@localhost.localdomain [Thu, 31 May 2007 09:30:15 +0000 (10:30 +0100)]
Fix the very-slow-IDE-IO-speed issue of Qemu 0.90

c/s 15021 updated Qemu to 0.90. In the new Qemu's ide.c, asynchronous
IO (AIO) is used to replace the previous DMA thread; here when an AIO
request is completed, dom0 sends a signal SIGUSR2 to Qemu (see
block-raw.c: qemu_aio_init(),raw_aio_setup()), then the signal
interrupts the select() in main_loop_wait() at once, next,
qemu_aio_poll() is called to reap a completed AIO request.

However, in certain Linux distributions (i.e., x86_64 RHEL 4u4), if
Qemu is spawned by the python script image.py of Control Panel, the
SIGUSR2 of Qemu is blocked by default due to some reasons (i.e. it
seems Python 2.3.4 has this issue; 2.4.2 is ok); so in most cases the
select() in main_loop_wait() can only time out in 10ms, then the
qemu_aio_poll() is called - this results in a very slow disk IO
speed...

This patch ensures aio_sig_num is unblocked when the AIO is used in
Qemu 0.90.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
18 years agohvm: Correctly hook VLAPIC MSR change notification for VMX into
kfraser@localhost.localdomain [Thu, 31 May 2007 08:49:53 +0000 (09:49 +0100)]
hvm: Correctly hook VLAPIC MSR change notification for VMX into
save/restore path.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoRemove 'hpet_force' option. Replace with 'clocksource' option to allow
kfraser@localhost.localdomain [Wed, 30 May 2007 17:29:21 +0000 (18:29 +0100)]
Remove 'hpet_force' option. Replace with 'clocksource' option to allow
forced selection of platform clocksource, overriding the default
priority ordering.

Usage: clocksource={pit,hpet,cyclone,acpi}

Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoAdd support for ACPI PM Timer as platform clock source.
kfraser@localhost.localdomain [Wed, 30 May 2007 17:12:02 +0000 (18:12 +0100)]
Add support for ACPI PM Timer as platform clock source.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoClean up around domain init/destroy.
kfraser@localhost.localdomain [Wed, 30 May 2007 16:47:00 +0000 (17:47 +0100)]
Clean up around domain init/destroy.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoMake header mismatch checking more robust against build time changes in
Ian Campbell [Wed, 30 May 2007 16:37:58 +0000 (17:37 +0100)]
Make header mismatch checking more robust against build time changes in
xen/include/public/foreign.

Unfortunately diff's -x and -X options do not support excluding paths just
individual files so we have to list unqualified filenames. This is ok for now
since there are no filename clashes.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
18 years agoSimplify APIC_ACCESS VMX support.
kfraser@localhost.localdomain [Wed, 30 May 2007 16:01:26 +0000 (17:01 +0100)]
Simplify APIC_ACCESS VMX support.
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoAdd VMX memory-mapped Local APIC access optimization.
kfraser@localhost.localdomain [Wed, 30 May 2007 15:48:28 +0000 (16:48 +0100)]
Add VMX memory-mapped Local APIC access optimization.

Some operating systems access the local APIC TPR very frequently, and
we handle that using software-based local APIC virtualization in Xen
today. Such virtualization incurs a number of VM exits from the
memory-access instructions against the APIC page in the guest.

The attached patch enables the TPR shadow feature that provides APIC
TPR virtualization in hardware. Our tests indicate it can
significantly boost the performance of such guests including 32-bit
Windows XP/2003.

Moreover, with the patch, local APIC accesses other than TPR in guests
are intercepted directly as APIC_ACCESS VM exits rather than
PAGE_FAULT VM exits; this can lower the emulation cost of such
accesses.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
18 years agoCheck for mismatch between headers shared by Linux and Xen.
Ian Campbell [Wed, 30 May 2007 12:10:20 +0000 (13:10 +0100)]
Check for mismatch between headers shared by Linux and Xen.

This is only enabled for the linux-2.6-xen tree and is intended to
ensure that the separate Linux tree stays up to date once we
switch away from the sparse tree.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
18 years agoFix preemption of multicalls in compat mode.
Ian Campbell [Wed, 30 May 2007 10:55:38 +0000 (11:55 +0100)]
Fix preemption of multicalls in compat mode.

mcs->call (struct multicall_entry) always needs to be translated into
mcs->compat_call (struct compat_multicall_entry) when a multicall is
preempted in compat mode. Previously this translation only occured for
those hypercalls which explicitly called hypercall_xlat_continuation()
which doesn't cover all hypercalls which could potentially be
preempted.

Change hypercall_xlat_continuation() to only translate only the
hypercall arguments themselves and not the multicall_entry
layout. Translate the layout for all hypercalls in in
compat_multicall() instead.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
18 years ago[NET] back: Add lazy copying
kfraser@localhost.localdomain [Wed, 30 May 2007 09:47:05 +0000 (10:47 +0100)]
[NET] back: Add lazy copying

This patch adds lazy copying using the new unmap_and_replace grant
table operation.

We keep a list of pending entries sorted by arrival order.  We'll
process this list every time net_tx_action is invoked.  We ensure
that net_tx_action is invoked within one second of the arrival of
the first packet in the list.

When we process the list any entry that has been around for more
than half a second is copied.  This allows up to free the grant
table entry and return it to domU.

If the new grant table operation is not available (e.g., old HV
or architectures that don't support it yet) we simply copy each
packet as we receive them using skb_linearize.  We also disable
SG/TSO if this is the case.

By default the new code is disabled.  In order to enable it,
the module needs to be loaded with the argument copy_skb=1.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
18 years ago[LINUX] gnttab: Add basic DMA tracking
kfraser@localhost.localdomain [Wed, 30 May 2007 09:46:13 +0000 (10:46 +0100)]
[LINUX] gnttab: Add basic DMA tracking

This patch adds basic tracking of outstanding DMA requests on
grant table entries marked as PageForeign.

When a PageForeign struct page is about to be mapped for DMA,
we set its map count to 1 (or zero in actual value).  This is
then checked for when we need to free a grant table entry early
to ensure that we don't free an entry that's currently used for
DMA.

So any entry that has been marked for DMA will not be freed early.

If the unmapping API had a struct page (which exists for the sg
case) then we could do this properly.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
18 years ago[XEN] gnttab: Add new op unmap_and_replace
kfraser@localhost.localdomain [Wed, 30 May 2007 09:45:44 +0000 (10:45 +0100)]
[XEN] gnttab: Add new op unmap_and_replace

The operation unmap_and_replace is an extension of unmap_grant_ref.
A new argument in the form of a virtual address (for PV) is given.
Instead of modifying the PTE for the mapped grant table entry to
null, we change it to the PTE for the new address.  In turn we
point the new address to null.

As it stands grant table entries once mapped cannot be
remapped by the guest OS (it can however perform a new
mapping on the same entry but that is within our control).
Therefore it's safe to manipulate the mapped PTE entry to
redirect it to a normal page where we've copied the contents.

It's intended to be used as follows:

1) map_grant_ref to v1
2) ...
3) alloc page at v2
4) copy the page at v1 to v2
5) unmap_and_replace v1 with v2

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Added compat integration (PAE-on-64).

Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoxend: Don't destroy domains on shutdown timeout.
kfraser@localhost.localdomain [Wed, 30 May 2007 09:06:23 +0000 (10:06 +0100)]
xend: Don't destroy domains on shutdown timeout.

Do not destroy domains on shutdown timeout: the administrator needs to
be able to decide what to do if a domain does not shut down.

Signed-off-by: John Levon <john.levon@sun.com>
18 years agoFix xenstore entry accounting
kfraser@localhost.localdomain [Wed, 30 May 2007 09:04:23 +0000 (10:04 +0100)]
Fix xenstore entry accounting

xenstored is incorrectly accounting domain nodes when transactions
fail. Store pending count changes in the transaction structure, and
apply at transaction completion, instead of directly applying the
changes.

Signed-off-by: Max Zhen <max.zhen@sun.com>
18 years agoFix xen build on NetBSD.
kfraser@localhost.localdomain [Wed, 30 May 2007 08:59:09 +0000 (09:59 +0100)]
Fix xen build on NetBSD.
From: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
18 years agoxen: Remove assumption that first NUMA node to be discovered is node0.
kfraser@localhost.localdomain [Wed, 30 May 2007 08:51:38 +0000 (09:51 +0100)]
xen: Remove assumption that first NUMA node to be discovered is node0.

Based on a patch by Alex Williamson.

Signed-off-by: Keir Fraser <keir@xensource.com>